package ${pPackage}.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;
<#if table.comment??>
/**
 * ${table.comment}
 */
<#else>
</#if>
@ApiModel(value = "${ClassName}", description = "${table.comment}")
@Table(name = "${table.name}")
public class ${ClassName} implements Serializable {

    <#list table.columns as column>
    <#if column.columnComment??>
    ${"//"} ${column.columnComment}
    @ApiModelProperty(value="${column.columnComment}")
    </#if>
    <#if column.columnKey??>
    @Id
    </#if>
    private ${column.columnType} ${column.columnName2};
    </#list>

    <#if table.name=="sys_permission">
    // 菜单
    private PermissionMenu permissionMenu;

    // 按钮
    private PermissionPoint permissionPoint;

    // 接口
    private PermissionApi permissionApi;

    // 子节点
    @ApiModelProperty(value = "子节点")
    private List<Permission> children;

    public PermissionMenu getPermissionMenu() {return permissionMenu;}
    public void setPermissionMenu(PermissionMenu permissionMenu) {this.permissionMenu = permissionMenu;}
    public PermissionPoint getPermissionPoint() {return permissionPoint;}
    public void setPermissionPoint(PermissionPoint permissionPoint) {this.permissionPoint = permissionPoint;}public PermissionApi getPermissionApi() {return permissionApi;}
    public void setPermissionApi(PermissionApi permissionApi) {this.permissionApi = permissionApi;}
    public void setChildren(List<Permission> children) { this.children = children; }
    public List<Permission> getChildren() {return children;}
    </#if>

    <#list table.columns as column>
    public void set${column.columnName2?cap_first}(${column.columnType} value) {
        this.${column.columnName2} = value;
    }
    public ${column.columnType} get${column.columnName2?cap_first}() {
       return this.${column.columnName2};
    }
    </#list>
}
